#encoding:gbk
import json
def readJSON(filename):
    with open(filename,"r",encoding="utf-8") as f:
        lst = json.load(f)
    print(lst)
    return lst
def dict_to_lst(lst):
    lst_new = []
    lst_title = list(lst[0].keys())
    lst_new.append(lst_title)
    for item in lst:
        lst_new.append(list(item.values()))
    print(lst_new)
    return lst_new
def writeJSON(filename,lst_new):
    with open(filename,"w",encoding="utf-8") as f:
        for item in lst_new:
            f.write(",".join(item)+"\n")
lst = readJSON("score.json")
lst_new = dict_to_lst(lst)
writeJSON("score_new.csv",lst_new)
# print(lst)
